/**
  @file     	DESIGNPATTERN_Entry.cpp
  @brief    	1.When the algorithm to create complex object should be independent of the part of the object, 
                  as well as their assembly;
				2.When construction process must be allowed to construct the object is different;
  @author  	arvin
  @version 	1.0   2012/12/20
 */

#include "stdafx.h"

#ifndef CXX_DESIGNPATTERN_ENTRY_H
#include "DESIGNPATTERN_Entry.h"
#endif

const string Entry::STATIC_CONST_STRING_ENTRY[Entry::ENTRY_ALL] = {
	"ENTRY_NONE",
	"ENTRY_FILE",
	"ENTRY_DIRECTORY"
};

 /**
 * Construction
 *
 * @param ENTRY_TYPE eEntry
 * @param const string& strName
 * @param int iSize
 * @return
 */
Entry::Entry(ENTRY_TYPE eEntry, const string& strName, int iSize) :
	m_eEntry(eEntry),
	m_strName(strName),
	m_iSize(iSize)
{
	DEBUG_PRINTF("eEntry[%d], Entry[%s]", m_eEntry, STATIC_CONST_STRING_ENTRY[m_eEntry].c_str());
}

/**
* Destruction
*
* @param VOID
* @return
*/
Entry::~Entry()
{
	DEBUG_PRINTF("eEntry[%d], Entry[%s]", m_eEntry, STATIC_CONST_STRING_ENTRY[m_eEntry].c_str());
}

/**
* PrintList
*
* @param VOID
* @return VOID
*/
VOID 
Entry::PrintList()
{
	DEBUG_PRINTF("eEntry[%d], Entry[%s]", m_eEntry, STATIC_CONST_STRING_ENTRY[m_eEntry].c_str());
	DEBUG_PRINTF("strName[%s], iSize[%d]", m_strName.c_str(), m_iSize);
}

/**
* GetEntry
*
* @param VOID
* @return ENTRY_TYPE
*/
Entry::ENTRY_TYPE
Entry::GetEntry()
{
	DEBUG_PRINTF("eEntry[%d], Entry[%s]", m_eEntry, STATIC_CONST_STRING_ENTRY[m_eEntry].c_str());
	return m_eEntry;
}

/**
* GetName
*
* @param VOID
* @return string
*/
string 
Entry::GetName()
{
	DEBUG_PRINTF("eEntry[%d], Entry[%s]", m_eEntry, STATIC_CONST_STRING_ENTRY[m_eEntry].c_str());
	return m_strName;
}

/**
* GetSize
*
* @param VOID
* @return int
*/
int 
Entry::GetSize()
{
	DEBUG_PRINTF("eEntry[%d], Entry[%s]", m_eEntry, STATIC_CONST_STRING_ENTRY[m_eEntry].c_str());
	return m_iSize;
}


/**
* SetEntry
*
* @param ENTRY_TYPE eEntry
* @return
*/
VOID 
Entry::SetEntry(ENTRY_TYPE eEntry)
{
	DEBUG_PRINTF("eEntry[%d], Entry[%s]", m_eEntry, STATIC_CONST_STRING_ENTRY[m_eEntry].c_str());
	m_eEntry = eEntry;
}

/**
* SetName
*
* @param const string& strName
* @return
*/
VOID 
Entry::SetName(const string& strName)
{
	DEBUG_PRINTF("eEntry[%d], Entry[%s]", m_eEntry, STATIC_CONST_STRING_ENTRY[m_eEntry].c_str());
	m_strName = strName;
}

/**
* SetSize
*
* @param int iSize
* @return
*/
VOID 
Entry::SetSize(int iSize)
{
	DEBUG_PRINTF("eEntry[%d], Entry[%s]", m_eEntry, STATIC_CONST_STRING_ENTRY[m_eEntry].c_str());
	m_iSize = iSize;
}
/* EOF */